package chapter09

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/12 19:16
  * @history:
  *          1.2019/1/12 created by chuhaitao
  */
object MixXinDemo5 {
  def main(args: Array[String]): Unit = {

  }
}


trait LoggerException extends Exception {

  def getMessages(): Unit = {
    getMessage
  }

}

//相当于LoggerException2  extends Exception
trait LoggerException2 {
  //告诉编译器自身类型，混入该特质的类的超类必须也是Exception的子类
  this: Exception =>
  def getMessages(): Unit = {
    getMessage
  }

}